#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n, k;

signed main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    int T;
    cin >> T;
    while (T--) {
        cin >> n >> k;
        bool flag = 1;
        if (2 * k - 1 > n) {
            puts("-1");
        }
        else {
            int now = 0;
            for (int i = 0; i < n; i++) {
                bool dex = 0;
                for (int j = 0; j < n; j++) {
                    if (i % 2 == 0) {
                        if (j == now && dex == 0 && k) {
                            printf("R");
                            now += 2;
                            dex = 1;
                            k--;
                        }
                        else {
                            printf(".");
                        }
                    }
                    else {
                        printf(".");
                    }
                }
                puts("");
            }
        }
    }
}